import { Controller, Get, Post, Body } from '@nestjs/common';
import { DogService } from './dog.service';
import { ApiOperation } from '@nestjs/swagger';
import { JwtNoVerify } from '../../decorators';
import { DogDto, DogUpdateDto } from './dto/dog.dto';

@Controller('dog')
export class DogController {
  constructor(private readonly dogService: DogService) {}

  @Post('add-dog')
  @JwtNoVerify()
  @ApiOperation({ summary: '添加狗狗数据' })
  async create(@Body() dog: DogDto) {
    return await this.dogService.create(dog);
  }

  @Get('dog-list')
  @JwtNoVerify()
  @ApiOperation({ summary: '获取所有狗狗数据' })
  async findAll() {
    return await this.dogService.findAll();
  }

  @Post('update-dog')
  @JwtNoVerify()
  @ApiOperation({ summary: '更新狗狗数据' })
  async update(@Body() dog: DogUpdateDto) {
    return await this.dogService.update(dog);
  }
}
